import request from '@/z/callback/request'
import { ElMessage } from 'element-plus'
import parfn from '@/utils/par'
export async function baserequest(url, data = {}) {
  let par = await request(url, data)
  par = parfn(par)
  ElMessage({
    message: par.label,
    type: par.value == 'succeed' ? 'success' : 'error',
  })
  return par
}
export function getList(params) {
  return request({
    url: '/base/getList',
    method: 'get',
    params,
  })
}

export function doEdit(data) {
  return request({
    url: '/base/doEdit',
    method: 'post',
    data,
  })
}

export function doDelete(data) {
  return request({
    url: '/base/doDelete',
    method: 'post',
    data,
  })
}
